package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 用户地址表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_user_addresses")
@Data
public class UserAddresses extends Model<UserAddresses> {

    private static final long serialVersionUID = 1L;

    /**
     * 地址唯一标识
     */
    @TableId("address_id")
    private Long addressId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 收件人手机号
     */
    @TableField("recipient_phone")
    private String recipientPhone;
    /**
     * 详细地址
     */
    private String address;
    /**
     * 城市
     */
    private String city;
    /**
     * 省份
     */
    private String state;
    /**
     * 邮政编码
     */
    @TableField("postal_code")
    private String postalCode;
    /**
     * 是否为默认地址（0：否，1：是）
     */
    @TableField("is_default")
    private Integer isDefault;

    private Integer status;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 修改时间
     */
    @TableField("update_date")
    private Date updateDate;

    public UserAddresses() {
        this.addressId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getRecipientPhone() {
        return recipientPhone;
    }

    public void setRecipientPhone(String recipientPhone) {
        this.recipientPhone = recipientPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    @Override
    public String toString() {
        return "UserAddresses{" +
        ", addressId=" + addressId +
        ", userId=" + userId +
        ", recipientPhone=" + recipientPhone +
        ", address=" + address +
        ", city=" + city +
        ", state=" + state +
        ", postalCode=" + postalCode +
        ", isDefault=" + isDefault +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
